/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 主内容区域 */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 20px;
}

/* 挑战区域 */
.challenge-section {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.word-display {
  margin-bottom: 30px;
  padding: 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  color: white;
  position: relative;
}

.word-text {
  font-size: 48px;
  font-weight: bold;
  margin-top: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.grade-badge {
  font-size: 14px;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  margin-right: 15px;
  backdrop-filter: blur(10px);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.weight-badge {
  font-size: 12px;
  font-weight: 600;
  background-color: #ff4757;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.answer {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  font-size: 30px;
  border: 3px solid #e0e0e0;
  border-radius: 15px;
  margin-bottom: 20px;
  text-align: center;
  transition: all 0.3s ease;
  outline: none;
}

.answer:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
  font-size: 30px;
}

.answer::placeholder {
  color: #999;
}

.btnSubmit, .btnStart {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btnSubmit:hover, .btnStart:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.btnSubmit:active, .btnStart:active {
  transform: translateY(-1px);
}

/* 进度条 */
.listen-records {
  margin-top: 30px;
  text-align: center;
}

.listen-records h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 20px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background-color: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 16px;
  color: #666;
  font-weight: 600;
}

/* 挑战记录区域 */
.records-section {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.records-section h2 {
  color: #333;
  margin-bottom: 25px;
  font-size: 28px;
  text-align: center;
}

.challenge-records {
  max-height: 500px;
  overflow-y: auto;
}

.challenge-record-item {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 10px 15px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 4px solid #ddd;
}

.challenge-record-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.challenge-record-item.success {
  border-left-color: #2ed573;
  background: linear-gradient(135deg, #f8f9fa 0%, #e8f5e8 100%);
}

.challenge-record-item.failed {
  border-left-color: #ff4757;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffe8e8 100%);
}

.record-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.record-time {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  flex-shrink: 0;
}

.record-stats-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stat-item {
  font-size: 11px;
  color: #666;
  background: white;
  padding: 3px 6px;
  border-radius: 12px;
  font-weight: 500;
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 900px;
  height: 95vh;
  max-height: 100vh;
  overflow-y: auto;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid #eee;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px 20px 0 0;
}

.modal-header h3 {
  font-size: 24px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.close-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 5px 10px;
}

/* 单词详情单行布局 */
.word-detail-content {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.word-separator {
  color: #ccc;
  margin: 0 3px;
  font-weight: bold;
  font-size: 10px;
}

.word-detail-item.incorrect .word-separator {
  color: #ff4757;
}

/* 挑战详情页面中的grade-badge样式 */
.word-detail-item .grade-badge {
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  margin-right: 8px;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 单词详情列表 */
.detail-words h4 {
  color: #333;
  margin-bottom: 20px;
  font-size: 20px;
}

.word-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  max-height: 600px;
}

.word-column {
  display: flex;
  flex-direction: column;
}

.column-title {
  color: #333;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 2px solid;
}

.correct-column .column-title {
  color: #2ed573;
  border-bottom-color: #2ed573;
}

.incorrect-column .column-title {
  color: #ff4757;
  border-bottom-color: #ff4757;
}

.word-list {
  flex: 1;
  overflow-y: auto;
}

.word-detail-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 3px;
  border-left: 3px solid #ddd;
  transition: all 0.3s ease;
}

.word-detail-item.correct {
  border-left-color: #2ed573;
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f9f0 100%);
  border-left-width: 3px;
}

.word-detail-item.incorrect {
  border-left-color: #ff4757;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
  border-left-width: 4px;
}

.word-number {
  font-weight: bold;
  color: #333;
  min-width: 20px;
  font-size: 12px;
}

.word-chinese {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.word-english {
  color: #666;
  font-style: italic;
  font-size: 18px;
}

.user-answer {
  color: #666;
  font-size: 11px;
  font-weight: 500;
}

.wrong-answer {
  text-decoration: line-through;
  color: #ff4757;
  font-weight: 600;
}

.word-detail-item.incorrect .user-answer {
  color: #ff4757;
  font-weight: 600;
  text-decoration: line-through;
  font-size:16px;
}

.result-status {
  font-weight: bold;
  font-size: 14px;
}

.word-detail-item.correct .result-status {
  color: #2ed573;
}

.word-detail-item.incorrect .result-status {
  color: #ff4757;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .container {
    padding: 10px;
  }
  
  .challenge-section, .records-section {
    padding: 20px;
  }
  
  .word-text {
    font-size: 32px;
  }
  
  .detail-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-content {
    width: 95%;
    margin: 10px;
  }
  
  .modal-header, .modal-body {
    padding: 1px 10px;
  }
  
  .record-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .record-stats-inline {
    justify-content: flex-start;
  }
  
  .word-detail-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .word-detail-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  
  .word-separator {
    display: none;
  }
}

/* 滚动条样式 */
.challenge-records::-webkit-scrollbar,
.word-list::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.challenge-records::-webkit-scrollbar-track,
.word-list::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.challenge-records::-webkit-scrollbar-thumb,
.word-list::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.challenge-records::-webkit-scrollbar-thumb:hover,
.word-list::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 答题反馈样式 */
.answer-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 400px;
  max-width: 500px;
  animation: feedbackSlideIn 0.3s ease;
  border: 4px solid;
}

.answer-feedback.correct {
  border-color: #2ed573;
  background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.answer-feedback.incorrect {
  border-color: #ff4757;
  background: linear-gradient(135deg, #fff8f8 0%, #ffe8e8 100%);
}

@keyframes feedbackSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.feedback-icon {
  font-size: 48px;
  font-weight: bold;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.answer-feedback.correct .feedback-icon {
  background: #2ed573;
  color: white;
}

.answer-feedback.incorrect .feedback-icon {
  background: #ff4757;
  color: white;
}

.feedback-content {
  flex: 1;
}

.feedback-message {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

.feedback-details {
  font-size: 16px;
  color: #666;
}

.feedback-details strong {
  color: #2ed573;
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(135deg, #2ed573 0%, #1e8a4a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(46, 213, 115, 0.3);
  padding: 4px 8px;
  border-radius: 8px;
  border: 2px solid #2ed573;
  display: inline-block;
  margin: 0 4px;
}

.feedback-hint {
  font-size: 14px;
  color: #999;
  margin-top: 10px;
  font-style: italic;
}

.feedback-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.feedback-close:hover {
  background: #f0f0f0;
  color: #666;
}

/* 响应式设计中的反馈样式 */
@media (max-width: 768px) {
  .answer-feedback {
    min-width: 300px;
    max-width: 90%;
    padding: 20px;
    flex-direction: column;
    text-align: center;
  }
  
  .feedback-icon {
    font-size: 36px;
    width: 50px;
    height: 50px;
  }
  
  .feedback-message {
    font-size: 18px;
  }
  
  .feedback-details {
    font-size: 14px;
  }
  
  .feedback-details strong {
    font-size: 16px;
    padding: 3px 6px;
  }
}

/* 最终答案样式 */
.final-answer {
  color: #2ed573;
  font-weight: 600;
  margin-left: 8px;
  font-size: 0.9em;
}